import request from '@/common/request/request.js'
import {
  stringFormat,
  toQueryString
} from '../utils/util.js' //组件用正则 过滤传递的参数

const GET = 'GET'
const POST = 'POST'
const PUT = 'PUT'
const DELETE = 'DELETE'



export function getUserList (data) {
  return request(data, "/operate/page", GET).then(res => res)
}

export function getUserTabCount (data) {
  return request(data, "/operate/getInfo", GET).then(res => res)
}


export function addConsultUser (data) {
  return request(data, "/operate/addConsultUser", POST).then(res => res)
}

export function addEshopUser (data) {
  return request(data, "/operate/addEshop", POST).then(res => res)
}

export function getConfigDict (data) {
  return request(data, "/operate/eShopCaChe", GET).then(res => res)
}


export function getQRCodeForUser (data) {
  return request(data, "/operate/getQRCodeForUser", GET).then(res => res)
}



export function checkExistPhone (data) {
  return request(data, "/existPhone", GET).then(res => res)
}


// export function checkExistPhone(data) {
//   return request(data, "/existPhone", GET).then(res => res)
// }

export function getGoodsList (data) {
  return request(data, "/eshopGoods/products", GET).then(res => res)
}

export function getStaffList (data) {
  return request(data, "/operate/sysUserAdvisor", GET).then(res => res)
}



export function editAllotUser (data) {
  return request(data, `/operate/editAllotUser?userUid=${data.userUid}&allotUser=${data.allotUser}`, POST).then(res => res)
}


export function getUserInfoByUserId (data) {
  return request(data, "/operate/getUserInfoByUserId", GET).then(res => res)
}



export function getChannelOptsList (data) {
  return request(data, "/getOptsList/store/userSourceChanel/getOptsList", GET).then(res => res)
}
